{% extends 'xadmin/base.html' %}
{% load i18n xadmin_tags %}
{% load url from future %}
{% load firstof from future %}

{% block title %}{{ title }} | {{ site_title }}{% endblock %}
{% block bodyskin %}skin-blue sidebar-mini {% endblock %}
{% block body %}
 <div class="wrapper">
  <!-- Header -->
  <header class="main-header">
    <!-- Logo -->
    <a href="{% url 'xadmin:index' %}" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini">{% block branding_mini %}<i class="fa fa-dashboard"></i>{% endblock %}</span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg">{% block branding %}<b>{{ site_title }}</b> {{ site_subtitle }}{% endblock %}</span>
    </a>
    
    
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>
      <div class="">
         <ul class="nav navbar-nav">
            <li><a class="navbar-brand" data-toggle="collapse" data-target="#top-nav .navbar-collapse">{% block nav_title %}{% endblock %}</a></li>
            {% view_block 'nav_menu' %}
            {% view_block 'nav_btns' %}
            <li>{% view_block 'nav_form' %}{% block nav_form %}{% endblock %}</li>
            {% block nav_btns %}{% endblock %}
         </ul>
      </div>
      
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
            {% view_block 'top_navmenu' %}
                {% if user.is_active and user.is_staff %}
                <li class="dropdown">
                    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
                    <strong>{% trans 'Welcome,' %} {% firstof user.first_name user.username %}</strong> <span class="caret"></span></a>
                  <ul id="g-account-menu" class="dropdown-menu" role="menu">
                    {% view_block 'top_account_menu' %}
                  </ul>
                </li>
                {% endif %}
                <li><a href="{% url 'xadmin:logout' %}"><i class="show-sm fa fa-sign-out"></i><span class="hide-sm">{% trans 'Log out' %}</span></a></li>
            {% block content-nav %}
            {% view_block 'nav_toggles' %}
            {% block nav_toggles %}
            {% include "xadmin/includes/toggle_back.html" %}
            {% endblock %}
        
            
          </ul>
      </div>
      {% endblock %}
    </nav>
    
  </header>
  <aside class="main-sidebar">
      <!-- sidebar: style can be found in sidebar.less -->
      <section style="height: auto;" class="sidebar">
        <!-- search form -->
        {% block top-nav %}
          {% view_block 'top_navbar' %}
        {% endblock %}
        <!-- /.search form -->
        
        <!-- sidebar menu: : style can be found in sidebar.less -->
        {% block navbar %}
        {% if nav_menu %}
         {% include menu_template %}
        {% else %}
         <p>{% trans "You don't have permission to edit anything." %}</p>
        {% endif %}
        {% endblock %}
        {% view_block 'left_navbar' %}
      </section>
      <!-- /.sidebar -->
  </aside>
   
  <div style="min-height: 1096px;" class="content-wrapper">
    <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            {% if title %}{{ title }}{% endif %}
            {% if subtitle %}<small>{{ subtitle }}</small>{% endif %}
          </h1>
          {% block breadcrumbs %}
	      <ol class="breadcrumb">
	       {% if breadcrumbs %}
	          {% for bc in breadcrumbs %}
	             <li>{% if forloop.last or not bc.url %}{{bc.title}}{% else %}<a href="{{bc.url}}">{{bc.title}}</a>{% endif %}</li>
	          {% endfor %}
	       {% else %}
	          <li><a href="{% url 'xadmin:index' %}">{% trans 'Home' %}</a></li>
	          
	       {% endif %}
	      </ol>
	      {% endblock %}
        </section>
        
        <!-- Main content -->
        <section class="content">
          {% block messages %}
            {% if messages %}
                {% for message in messages %}
                    <div class="alert alert-dismissable{% if message.tags %} {% if message.tags == 'error' %}alert-danger{% else %}alert-{{ message.tags }}{% endif %}{% endif %}">
                        <button type="button" class="close" data-dismiss="alert">&times;</button>
                    {{ message|safe }}
                    </div>
                {% endfor %}
            {% endif %}
          {% endblock messages %}
        
        
          {% block content %}
          {{ content }}
          {% endblock %}
        </section><!-- /.content -->
      </div>

  {% block footer %}
  <footer class="main-footer" id="footer">
    {% block site_footer %}{{ site_footer }}{% endblock %}
  </footer>
  {% endblock %}
 </div>
{% endblock body %}
